package algorithme;

import reservation.Trajet;

/**
 * Classe Noeud : Représente un noeud sur un graphe
 * 
 * @author Alexandre Boursier and Mamadou Diallo and Cyril Gorrieri and Emmanuel
 *         Menage
 * @version 2012.01.23
 */
public class Noeud implements Comparable<Noeud> {
	private final String nom;
	private Liaison[] liaisons;
	private double poidMin = Double.POSITIVE_INFINITY;
	private Noeud precedent;
	private Trajet precedentTrajet;

	public Noeud(String argName) {
		nom = argName;
	}

	public String toString() {
		return nom;
	}

	public int compareTo(Noeud other) {
		return Double.compare(poidMin, other.poidMin);
	}

	/**
	 * @return the liaisons
	 */
	public Liaison[] getLiaisons() {
		return liaisons;
	}

	/**
	 * @param liaisons the liaisons to set
	 */
	public void setLiaisons(Liaison[] liaisons) {
		this.liaisons = liaisons;
	}

	/**
	 * @return the poidMin
	 */
	public double getPoidMin() {
		return poidMin;
	}

	/**
	 * @param poidMin the poidMin to set
	 */
	public void setPoidMin(double poidMin) {
		this.poidMin = poidMin;
	}

	/**
	 * @return the precedent
	 */
	public Noeud getPrecedent() {
		return precedent;
	}

	/**
	 * @param precedent the precedent to set
	 */
	public void setPrecedent(Noeud precedent) {
		this.precedent = precedent;
	}

	/**
	 * @return the precedentTrajet
	 */
	public Trajet getPrecedentTrajet() {
		return precedentTrajet;
	}

	/**
	 * @param precedentTrajet the precedentTrajet to set
	 */
	public void setPrecedentTrajet(Trajet precedentTrajet) {
		this.precedentTrajet = precedentTrajet;
	}

	/**
	 * @return the nom
	 */
	public String getNom() {
		return nom;
	}

}
